package com.itm.lqm.servlets.course;

import java.io.IOException;


import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.itm.lqm.entity.Course;
import com.itm.lqm.service.CourseService;


/**
 * Servlet implementation class updateStudent
 */
@WebServlet("/updateCourse")
public class updateCourse extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public updateCourse() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//获取业务逻辑层对象，修改是先查询到该对象然后修改
		
		int cid=Integer.parseInt(request.getParameter("cid"));//强制转换类型
		System.out.println(cid);
		CourseService ts=new CourseService();
		Course c= ts.findCourseByTid(cid);
		System.out.println("dedao"+c);
		request.setAttribute("c", c);
		request.getRequestDispatcher("updateCourse.jsp").forward(request, response);	
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

}
